package com.mtons.mblog.modules.repository;

import com.mtons.mblog.modules.entity.PostResource;
import com.mtons.mblog.modules.entity.Quest;
import com.mtons.mblog.modules.entity.QuestResource;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.Collection;
import java.util.List;

public interface QuestResourceRepository extends JpaRepository<QuestResource, Long>, JpaSpecificationExecutor<QuestResource> {

    int deleteByQuestId(long questId);

    int deleteByQuestIdAndResourceIdIn(long questId, Collection<Long> resourceId);

    List<QuestResource> findByResourceId(long resourceId);

    List<QuestResource> findByQuestId(long questId);
}
